package com.shiqi.bio.version4;

import java.util.concurrent.*;

/**
 * @author shiqi
 * @version 1.0.0
 * @ClassName HandlerSocketThreadPool.java
 * @Description 线程池处理类
 * @createTime 2022-05-16
 */
public class HandlerSocketThreadPool {

    private ExecutorService executor;

    public HandlerSocketThreadPool(int maxSize, int queueSize) {
        this.executor = new ThreadPoolExecutor(3, maxSize, 120L, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(queueSize));
    }

    public void execute(Runnable runnable) {
        this.executor.execute(runnable);
    }
}
